//
// Created by hps on 24-4-19.
//

#include "LineInputer.h"

namespace hps {
LineInputer::LineInputer(const std::string &labelText)
    : QWidget(), m_labelText(labelText) {
    m_Layout = new QHBoxLayout();
    m_Label = new QLabel();
    m_LineEdit = new QLineEdit();
    init();
    setUi();
}
void LineInputer::init() {
    m_Layout->setContentsMargins(0, 0, 0, 0);
    m_Layout->setSpacing(10);
    m_Label->setText(QString(m_labelText.c_str()));
}
void LineInputer::setUi() {
    this->setLayout(m_Layout);
    m_Layout->insertWidget(0, m_Label);
    m_Layout->insertWidget(1, m_LineEdit);
}
void LineInputer::setText(const QString &text) {
    m_LineEdit->setText(QString(text));
}
} // hps